<?php
namespace app\api\model;

use think\Db;

class UserModel  
{
    /**
     * 单例模式
     * @return UserModel
     *
     */
    public static function instance(){
        static $m = null;
        if(!$m){
            $m = new UserModel();
        }
        return $m;
    }
//    /**
//     * 登录
//     */
//    public function login_data($goodsid){
//        $loginId  = Db::name('business')->where(['bid'=>$goodsid,'status'=>1])->field('appid','secret')->select();
//        echo $loginId;
//    }
/**
     * 用户
     */
    public function userlist($uid){
        $result  = Db::name('user')->where(['uid'=>$uid])->field('uid,discounts')->find();
        return $result;
    }
    /**
     * 检测登录
     */
    public function checkLogin($datas){
        //$map['password'] = md5($map['password']);
        $data['status1'] = 1;
        $resule = Db::name('user')->field('uid')->where($datas)->find();
        return $resule;
    }

}
